
<link rel="stylesheet" href="__PUBLIC__/vendors/zTree_v3/css/zTreeStyle/zTreeStyle.css" type="text/css"/>

<script type="text/javascript" src="__PUBLIC__/vendors/zTree_v3/js/jquery.ztree.core-3.5.js"></script>

<script type=text/javascript>
var setting = { view: { showLine: true },data: { simpleData: { enable: true }}};
$(document).ready(function(){
var $user1 = $('#user1').val();
	$.ajax({
		type: "post",
		dataType : "json",
		global : false,
		url : "{:url('getTree')}",
		data : {
		user1 : $user1
		},
		success : function(data, textStatus) {
			if (data.status == 0){
				zNodes1 = data.data;
				$.fn.zTree.init($("#treeDemo"), setting, zNodes1);
			} else {
				alert("您還沒有");
			}
			return ;
		}
	});
});
$(function(){
$('#btn').click(function(){
var $user = $('#user').val();
$.ajax({
		type: "post",
		dataType : "json",
		global : false,
        url : "{:url('getTreeso')}",
		data : {
		user : $user
		},
		success : function(data, textStatus) {
			if (data.status == 0){
			//alert(data.nr);
				zNodes1 = data.data;
				$.fn.zTree.init($("#treeDemo"), setting, zNodes1);
			} else {
				alert(data.data);
			}
			return ;
		}
	});
});
})
</script>
<style type='text/css'>
	.toolbar li{text-align:center;height:22px;line-height:22px;padding:0;
	font-size:14px;background:#009688;}
	.toolbar li a{color:#fff;padding:5px 8px;}
	.dfinput{width:200px;height:22px;outline:none;border-radius:3px;line-height: 32px;border:solid 1px #a7b5bc;text-indent: 10px;}
	.btn{height:22px;width:80px;line-height:22px;background:#009688;border-radius:4px;font-size:12px;font-weight: bold;color: #fff;cursor: pointer;
	border:0;}
	input{outline:none;}
	.ztree li a{height:30px;}
	.ztree li a.curSelectedNode{height:30px;line-height:30px;}
	.ztree li span {line-height:30px;}
	.ztree li span.button{margin-top:7px;}
</style>
	<form class="form-inline"  method="get">
		<input name="user1" id="user1" type="hidden" value="{$user_id}" />
		<div class="form-group col-xs-2">
			<div class="col-xs-12">
				<input class="form-control" id="user" name="user"
				       placeholder="会员账号">
			</div>
		</div>
		<span id="daishu"></span>
		<div class="form-group col-xs-2">
			<div class="col-xs-12">
				<button type="button" class=" btn-success" id="btn">
					确认搜索
				</button>
			</div>
		</div>
	</form>

	<div class="content_wrap">
		<div class="zTreeDemoBackground ">
			<ul id="treeDemo" class="ztree"></ul>
		</div>
	</div>
	

